package chapter_6;

public class Test2 {
    public static void main(String[] args) {
        login("admin");
        login("aa");
    }
    public static void login(String name) throws RuntimeException {
        if("admin".equals(name)){
            System.out.println("成功登录");
        }else{
            throw new RuntimeException("登录失败");
        }
    }
}
